Handling Mysql permissions

Some useful SQL commands to handle permissions
mysql
databases
Published

February 7, 2015

This is for an old version of MySQL but it may work on your current version

Handling MySQL users and permissions

We are going to grant permissions for a given database to a specific user on a specific host. In the example we grant usage to localhost and a hostname to allow external access.

grant all privileges on dbname.* to 'dbname'@'localhost' identified by 'password';
grant all privileges on dbname.* to 'dbname'@'<FQN_hostname> ' identified by 'password';

Resources

13.7.5.17 SHOW GRANTS Syntax